Overriding a function in an instance [on hold]
        Posted  
        
            by 
                MustSeeMelons
            
        on Programmers
        
        See other posts from Programmers
        
            or by MustSeeMelons
        
        
        
        Published on 2013-11-05T10:30:51Z
        Indexed on 
            2013/11/05
            16:11 UTC
        
        
        Read the original article
        Hit count: 213
        
Is it possible to override a function by instance? For example, A and B are both instances of MyClass. I have a function Action(), and I want to specify its implementation for each instance. To be more specific - the class is a Button, and the function is Clicked(). I don't want to derive a class 5 times to create 5 different button actions. Was thinking of something like it's handled in Java Swing: create a button, add code for the button press and use the button.
© Programmers or respective owner